@extends('layouts.default')
@section('css')
    <link rel="stylesheet" href="{{asset('admin-lte/plugins/datatables/dataTables.bootstrap4.css')}}">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    {{--<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">--}}

@stop

@section('content')
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">商品管理 / <a class="text-primary" href="{{url('admin/property/index')}}">规格列表</a></h3>
                </div>

                <div class="card-body">
                    @include('layouts.message')
                    <button class="btn btn-info btn-sm" style="margin-bottom:10px" onclick="location.href='{{url('admin/property/create')}}'">添加规格</button>
                    <table id="example1" class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>操作</th>
                            <th>规格名称</th>
                            <th>规格值</th>
                        </tr>
                        </thead>
                        <tbody>
                         @foreach($rule_list as $v)
                        <tr>
                            <td>
                                <a href="{{url('admin/property/update',['props_id'=>$v['props_id']])}}" class="btn btn-info btn-sm">编辑</a>
                                <a href="{{url('admin/property/delete',['props_id'=>$v['props_id']])}}" class="btn btn-danger btn-sm">删除</a>
                            </td>
                            <td>{{$v['name']}}</td>
                            <td>{{$v['val_list']}}</td>
                        </tr>
                        @endforeach
                        </tbody>
                        <tfoot>
                        <tr>
                            <th></th>
                            <th></th>
                            <th></th>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
@stop


@section('script')
    <script src="{{asset('admin-lte/plugins/datatables/jquery.dataTables.js')}}"></script>
    <script src="{{asset('admin-lte/plugins/datatables/dataTables.bootstrap4.js')}}"></script>
    <script>
        $(function () {
            $("#example1").DataTable({
                "language"  : {
                    url :'https://cdn.datatables.net/plug-ins/1.10.19/i18n/Chinese.json'
                },
                //启用或者禁用某一列的排序功能
                "columnDefs": [
                    { "orderable": false, "targets": 0 }
                ],
            });

        });
    </script>
@stop
